package com.test.Mapper;

import com.test.entity.Book;
import com.test.entity.Borrow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BorrowMapper {

    @Select("select * from db_borrow where uid = db_borrow.uid")
    List<Borrow> getBorrowsByUid(Integer uid);

    @Select("select * from db_borrow where bid = db_borrow.bid")
    List<Borrow> getBorrowsByBid(Integer bid);

    @Select("select * from db_borrow where bid = db_borrow.bid and uid = db_borrow.uid")
    List<Borrow> getBorrows(Integer uid,Integer bid);
}
